const express = require('express')
const app = express()
app.get('/', (req, res ) => {
    let obj = {
        name: 'Xia',
        age: 22
    }
    res.send(obj)
})
app.get('/name', (req, res, next) => {
    req.name = '张三'
    next()
})
app.get('/name', (req, res) => {
    res.send(req.name)
})
app.listen(3000, () => {
    console.log('server is staring... at: http://127.0.0.1:3000')
})